import numpy as np
arr1 = np.array([[1,2,3],
          [4,5,6],
          [7,8,9]])
arr2 = np.array([[10,11],
          [12,13],
          [14,15]])
a=np.dot(arr1,arr2)
print(a)
print(arr1.ndim)
print(arr2.ndim)
def jsh_dot(a,b):
    if a.ndim == 2 and b.ndim == 2: # 保证数组都是二维数组
        x_a,y_a = a.shape # 简便写法
        x_b,y_b = b.shape
        if y_a == x_b: # 验证两个数组格式满足数组相乘
            temp = np.zeros((x_a,y_b),dtype=a.dtype) # 默认是浮点数类型，跟上述数组格式保持一致
            for x in range(x_a):
                for y in range(y_b):
                    temp[x][y] = sum(a[x][k]*b[k][y]for k in range(y_a))
            return temp
        else:
            print(f"矩阵形状不匹配：a的列数({y_a})不等于b的行数({x_b})")
    else:
        raise ValueError(f"输入必须是二维数组，但得到 a.ndim={a.ndim}, b.ndim={b.ndim}")
b=jsh_dot(arr1,arr2)
print("!!!!!!!!!!!!!!!!!!!!")
print(b)